package com.gaga.crm.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 
 * @TableName t_sys_user
 */
/*@Data*/
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Entity
@Table(name = "sys_user")
@NamedQueries(@NamedQuery(name="SysUser.findUsersByName",query="select u from SysUser u where u.name=?1"))
public class SysUser implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "usr_id")
    private Long id;

    @Column(name = "usr_name")
    private String name;

    @Column(name = "usr_password")
    private String password;

   /* @Column(name = "usr_role_id")
    private Long roleId;*/

    /*多对一关联属性*/
    @ManyToOne(targetEntity = SysRole.class)
    @JoinColumn(name = "usr_role_id")
    private SysRole role;

    @Column(name = "usr_flag")
    private Integer flag;

    public SysRole getRole() {
        return role;
    }

    public void setRole(SysRole role) {
        this.role = role;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

   /* public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }*/

    public Integer getFlag() {
        return flag;
    }

    public void setFlag(Integer flag) {
        this.flag = flag;
    }
}